package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.vo.SkuLockVo;
import com.spzx.product.api.domain.vo.SkuStockVo;
import com.spzx.product.api.fallback.SkuStockFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName SkuStockFeignClient
 * @Author 波
 * @Date 2024/8/5 20:35
 */
@FeignClient(contextId = "skuStockFeignClient", path = "/skuStock", value = ServiceNameConstants.PRODUCT_SERVICE, fallbackFactory = SkuStockFeignClientFallbackFactory.class)
public interface SkuStockFeignClient {
    @GetMapping("/getSkuStockVo/{skuId}")
    public R<SkuStockVo> getSkuStockVo(@PathVariable("skuId") Long skuId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @PostMapping("checkAndLock/{orderNo}")
    public R<String> checkAndLock(@PathVariable("orderNo") String orderNo, @RequestBody List<SkuLockVo> skuLockVoList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    }
